package aes;

import client.gui.Client_GUI;
import client.gui.GUI_Teacher_Add_Question;
import sharedspace.Question;
import sharedspace.Teacher;
import sharedspace.User;
import fit.ActionFixture;

public class AddQuestionTests extends ActionFixture{
	
	User user;
	
	Client_GUI client_GUI;
	GUI_Teacher_Add_Question gui_Teacher_Add_Question;
	
	public void startAddQuestion()
	{
		user = new User();
		client_GUI = new Client_GUI();
		gui_Teacher_Add_Question = new GUI_Teacher_Add_Question(client_GUI, user);
	}
	
	public void addQuestion(String question)
	{
		gui_Teacher_Add_Question.submitQuestion = question;
	}
	
	public void addAnswer1(String answer1)
	{
		gui_Teacher_Add_Question.submitAnswer[0] = answer1;
	}
	
	public void addAnswer2(String answer2)
	{
		gui_Teacher_Add_Question.submitAnswer[1] = answer2;
	}
	
	public void addAnswer3(String answer3)
	{
		gui_Teacher_Add_Question.submitAnswer[2] = answer3;
	}
	
	public void addAnswer4(String answer4)
	{
		gui_Teacher_Add_Question.submitAnswer[3] = answer4;
	}
	
	public void selectSubject(String subject)
	{
		gui_Teacher_Add_Question.subjectChoosen = subject;
	}
	
	public void selectCorrectAnswer(int correct)
	{
		gui_Teacher_Add_Question.question.setCorrectAnswer(correct);
	}
	
	public boolean allFieldAreFilled()
	{
		return gui_Teacher_Add_Question.AllFieldsAreOk();
	}
	
	public boolean allFieldAreNotFilled()
	{
		return !gui_Teacher_Add_Question.AllFieldsAreOk();
	}
	
	public boolean checkSelectSubject()
	{
		if (!gui_Teacher_Add_Question.subjectChoosen.equals(null))
				return true;
		return false;
	}
	
	public boolean checkNotSelectedSubject()
	{
		if (gui_Teacher_Add_Question.subjectChoosen.equals(null))
			return true;
		return false;
	}
	
	public boolean cheackSelectQuestion()
	{
		Question question = gui_Teacher_Add_Question.question;
		if (question.getCorrectAnswer()>0 && question.getCorrectAnswer()<5)
			return true;
		return false;
	}
	
	public boolean cheackNotSelectQuestion()
	{
		Question question = gui_Teacher_Add_Question.question;
		if (question.getCorrectAnswer()==0)
			return true;
		return false;
	}
	
	public boolean checkQuestionFilled()
	{
		if (!gui_Teacher_Add_Question.submitQuestion.equals(null))
			return true;
		return false;
	}
	
	public boolean checkNotQuestionFilled()
	{
		if (gui_Teacher_Add_Question.submitQuestion.equals(null))
			return true;
		return false;
	}
	
	
	
	
	
	
	

}
